package org.apache.ocean.main.util;

import java.util.Comparator;

public class NullLeastComparator<V extends Comparable<V>> implements Comparator<V> {
	public int compare(V o1, V o2) {
		if (o1 == o2) {
			return 0;
		}
		if (o1 == null) {
			return -1;
		}
		if (o2 == null) {
			return 1;
		}
		return o1.compareTo(o2);
	}
}
